<%--
 - Copyright (c) 2009-2011 ETCORE Labs. All rights reserved. 
 - 
 - This software is the confidential and proprietary information of ETCORE Labs. 
 - You shall not disclose such confidential information and shall use it only
 - in accordance with the terms of the license agreement you entered into
 - with ETCORE Labs.
 -
 - Support can be obtained from support forums at:
 - http://www.etcore.com/
 -
 - @author: ETCORE GroupTalk developers
 -
 --%>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://www.etcore.com/grouptalk" prefix="grouptalk"%>
<%@ taglib uri="http://jakarta.apache.org/taglibs/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<head>
<title><c:out value='${context.my_favourite }' />-<c:out
	value='${context.title }' /></title>
<link rel="stylesheet" href="/group/css/styles.css" type="text/css">
 
<script>

function showCalendar(){
	 var trigger=document.getElementById("trigger");
	 var eventDiv=document.getElementById("eventDiv");
	 var eventFrame=document.getElementById("eventFrame");
	 var eventWall=document.getElementById("eventWall");
	 if(eventDiv.style.display=="none"){
		 trigger.value='${context.hide_calendar}';
		// eventFrame.src= '/group/event<c:out value='${context.postfix}'/>?showFavourite=true';
		 eventDiv.style.display="";
	 }else{
		 trigger.value='${context.show_calendar}';
		 eventWall.style.height='30px';
		 eventDiv.style.display="none";
	 
	 }
}
 
</script> 
</head>
<body bottomMargin=0 leftMargin=10 topMargin=0 rightMargin=10
	marginheight="0">
<c:import url="/group/ui-component/divdialog/divdialog.html" />
<table cellpadding=0 cellspacing=0 width=100%  >
	<tr>
		<td colspan=2>
		<table width=100% cellspacing=0 cellpadding=0>
			<tr bgcolor="#E3EEFB">
				<td style="height: 50px; font-size: 14px; width: 300px;"><b>${context.my_favourite}</b><font
					color=#808080>(${myFavouriteCount})</font></td>
				<td align=right><%--
		<form name=f
			action="/group/myFavourite<c:out value='${context.postfix}' />"
			method=post>

		<table>
			<tr valign=top>
				<td style="height: 42px; padding-left: 0px" nowrap><input
					type=text name=key size=35 maxlength=100
					value="<c:out value='${param.key }' />"> <input type=submit
					value="search"></td>
			</tr>
		</table>
		</form>
		 --%></td>
			</tr>
		</table>

		</td>
	</tr>



	<c:set var="openValue" value="2" />
	<c:if test="${not empty param.open }">
		<c:set var="openValue" value="${param.open}" />
	</c:if>
	<c:if test="${not empty open }">
		<c:set var="openValue" value="${open}" />
	</c:if>
	<tr>
		<td style="font-weight: bold;"><c:if test="${isAdmin }">
			<a <c:if test="${openValue==1 }">style="color:red;" </c:if>
				href="/group/myFavourite${context.postfix }?open=1"><c:out
				value='${context.platform1 }' />(${infoMsgSize})</a>&nbsp;&nbsp;</c:if><a
			<c:if test="${openValue==2 }">style="color:red;" </c:if>
			href="/group/myFavourite${context.postfix }?open=2"><c:out
			value='${context.platform2 }' />(${communitiesMsgSize})</a>&nbsp;&nbsp;<a
			<c:if test="${openValue==3 }">style="color:red;" </c:if>
			href="/group/myFavourite${context.postfix }?open=3"><c:out
			value='${context.platform3 }' />(${bookmarksMsgSize })</a>&nbsp;&nbsp;<a
			<c:if test="${openValue==4 }">style="color:red;" </c:if>
			href="/group/myFavourite${context.postfix }?open=4"><c:out
			value='${context.platform4}' />(${remindersMsgSize })</a></td>
	</tr>

<c:if test="${all>0 }">
	<tr>
		<td align=right height=15 colspan=2><c:if
			test="${not empty param.key}">
			<c:out value='${context.text_find}' />&nbsp;<font color=red><c:out
				value='${param.key}' /></font>&nbsp;</c:if><c:out value='${context.text_related}' />&nbsp;<font
			color=red><c:out value='${all }' /></font>&nbsp;<c:out
			value='${context.text_item}' />:</td>
	</tr>
 
</c:if>
<c:if test="${all==0 }">
	<tr>
		<td align=center style="font-size:12px;color:red;">${context.default_none }</td>
	</tr>
 
</c:if>
 

	<c:if test="${openValue==4}">
 
		<tr>
			<td ><div id=eventWall style="height:520px; "><input id=trigger type=button
									style="border:0px;cursor: pointer; height: 20px; font-size: 12px; color: #ffffff; background: #36518B;"
									value='${context.hide_calendar }'
									onclick="showCalendar() " />
			<div id=eventDiv style="display:  "><Iframe id=eventFrame
				style="width: 100%"
				src='/group/event<c:out value='${context.postfix}'/>?showFavourite=true'
				height="480" scrolling="no" frameborder="0"></iframe></div>
</div>
			</td>
		</tr>
	</c:if>


 

	<c:if test="${openValue==3 }">
		<c:set var="mcount" value="0" />
		<c:forEach var="message" items="${msgs}">
			<c:if test='${mcount%2==0 }'>
				<tr>
			</c:if>

			<td width=50%>

			<table cellpadding=0 cellspacing=0 width=100%
				style="border: 1px solid #d4d2d4; table-layout: fixed; height: 160px">
				<tr bgcolor="#f3f3f3">
					<td nowrap align=left width=100% style="font-weight: bold;">
					<div style="overflow: hidden"><c:if
						test="${!(context.encryptedUrl3) }">
						<a
							href="/group/messagedetail<c:out value='${context.postfix}' />?id=<c:out value='${message[0]}' />"
							target=_blank> <c:if test="${empty param.key }">
							<c:out value='${message[2]}' />
						</c:if> <c:if test="${not empty param.key }">
							<c:out
								value="${grouptalk:getStringWithRedKey(message[2],param.key)}"
								escapeXml="false" />
						</c:if> </a>
					</c:if> <c:if test="${(context.encryptedUrl3) }">
						<c:set var='urlFragmentStr' value="?id=${message[0] }" />
						<c:set var='urlFragment'
							value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
						<a
							href="/group/messagedetail<c:out value='${context.postfix}' />/~<c:out value='${urlFragment }' />"
							target=_blank> <c:if test="${empty param.key }">
							<c:out value='${message[2] }' />
						</c:if> <c:if test="${not empty param.key }">
							<c:out
								value="${grouptalk:getStringWithRedKey(message[2],param.key)}"
								escapeXml="false" />
						</c:if> </a>
					</c:if></div>
					</td>

				</tr>

				<tr>
					<td colspan=2 style="font-size: 12px; color: #999999"><a
						style="font-size: 12px; color: blue;"
						title="<c:out value='${message[9]}' />"
						href="<c:out value='${message[9]}' />"> <c:out
						value='${fn:substring(message[9], 0, 40)}' /></a></td>
				</tr>
				<tr>
					<td colspan=2>
					<table style="margin-left: -4px;" align=left>
						<tr>
							<td><input type=button
								style="border:0px;cursor: pointer; height: 20px; font-size: 12px; color: #ffffff; background: #36518B;"
								value='${context.text_comment }'
								onclick="window.open('/group/messagedetail<c:out value='${context.postfix}' />?id=<c:out value='${message[0]}' />&init=reply');" />
							</td>
							<td>
							<form target=_parent
								action="/group/myFavourite${context.postfix }"><input
								type=hidden name=open value='${param.open}' /><input
								type=hidden name=gmid value='${message[0]}' /><input
								type=hidden name=cmd value='removeFavourite' /><input
								type=button onclick="submit();"
								style="border:0px;cursor: pointer; height: 20px; font-size: 12px; color: #ffffff; background: #36518B;"
								value='${context.del}' /></form>
							</td>
					</table>
					</td>
				</tr>

				<tr>
					<td align=left colspan=2 valign=top width=100%
						style="height: 105px">

					<div
						style="height: 100px; leftmargin: 2px; topmargin: 0px; overflow-y: auto">
					<a style="font-size: 12px; color: #999999;" target=_blank
						href="/group/messagedetail<c:out value='${context.postfix}' />?id=<c:out value='${message[0]}' />"><c:if
						test="${not empty message[8] }">
						<c:if test="${not empty param.key }">
							<c:out
								value="${grouptalk:getStringWithRedKey(message[8],param.key)}"
								escapeXml="false" />
						</c:if>
						<c:if test="${empty param.key }">
							<c:out value='${message[8] }' escapeXml="false" />
						</c:if>
					</c:if></a></div>

					</td>
				</tr>
				<tr>
					<td colspan=2 align=right width=100%
						style="font-size: 12px; color: #999999"><c:out
						value='${context.text_publish }' />：<c:out value='${message[3] }' /><c:set
						var="lastComment" value='${message[0] }lastComment' />&nbsp;<c:if
						test="${not empty requestScope[lastComment] }">
						<c:out value='${context.text_last_reply }' />：<c:out
							value='${requestScope[lastComment] }' />&nbsp;									
								</c:if></td>
				</tr>

				<tr>
					<td colspan=2 align=right width=100%
						style="font-size: 12px; color: #999999"><c:out
						value='${context.text_click }' />：<c:out value='${message[5] }' />
					&nbsp;<c:out value='${context.text_comment }' />：<c:set
						var="commentNum" value='${message[0] }commentNum' /><c:out
						value='${requestScope[commentNum] }' />&nbsp;</td>
				</tr>

			</table>


			</td>
			<c:if test='${mcount%2==1 }'>
				</tr>
			</c:if>
			<c:set var="mcount" value="${mcount+1 }" />

		</c:forEach>

		<c:if test='${count%2==0 }'>
			</tr>
		</c:if>



	</c:if>

	<c:if test="${openValue==2||openValue==1||openValue==4}">
		<c:forEach var="message" items="${msgs}">
			<tr>
				<td>

				<table cellpadding=0 cellspacing=0 width=100%>
					<tr>
						<td nowrap width=500 style="border-bottom: 1px solid #d2d4d2"><c:if
							test="${!(context.encryptedUrl1) }">
							<a style="font-size: 12px; cursor: pointer; color: #005EAC"
								href="/group/messagedetail<c:out value='${context.postfix}' />?id=<c:out value='${message[0]}' />"
								target=_blank> <c:if test="${empty param.key }">
								<c:out value='${message[2]}' />
							</c:if> <c:if test="${not empty param.key }">
								<c:out
									value="${grouptalk:getStringWithRedKey(message[2],param.key)}"
									escapeXml="false" />
							</c:if> </a>
						</c:if> <c:if test="${(context.encryptedUrl1) }">
							<c:set var='urlFragmentStr' value="?id=${message[0] }" />
							<c:set var='urlFragment'
								value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
							<a style="font-size: 12px; cursor: pointer; color: #005EAC"
								href="/group/messagedetail<c:out value='${context.postfix}' />/~<c:out value='${urlFragment }' />"
								target=_blank> <c:if test="${empty param.key }">
								<c:out value='${message[2] }' />
							</c:if> <c:if test="${not empty param.key }">
								<c:out
									value="${grouptalk:getStringWithRedKey(message[2],param.key)}"
									escapeXml="false" />
							</c:if> </a>
						</c:if></td>
						<td
							style="font-size: 12px; color: #808080; border-bottom: 1px solid #d2d4d2; text-align: right">${context.included_time
						}:${message[11] }</td>
					</tr>
					<tr>
						<td colspan=2>
						<table style="margin-left: -4px;" align=left>
							<tr>
								<td><input type=button
									style="border:0px;cursor: pointer; height: 20px; font-size: 12px; color: #ffffff; background: #36518B;"
									value='${context.text_comment }'
									onclick="window.open('/group/messagedetail<c:out value='${context.postfix}' />?id=<c:out value='${message[0]}' />&init=reply');" />
								</td>
								<td>
								<form target=_parent
									action="/group/myFavourite${context.postfix }"><input
									type=hidden name=open value='${param.open}' /><input
									type=hidden name=gmid value='${message[0]}' /><input
									type=hidden name=cmd value='removeFavourite' /><input
									type=button onclick="submit();"
									style="border:0px;cursor: pointer; height: 20px; font-size: 12px; color: #ffffff; background: #36518B;"
									value='${context.del}' /></form>
								</td>
						</table>
						</td>
					</tr>
					<c:if test="${not empty message[8] }">
						<tr>
							<td align=left colspan=2 width=100%
								style="font-size: 12px; color: #808080"><c:if
								test="${not empty param.key }">
								<c:out
									value="${grouptalk:getStringWithRedKey(message[8],param.key)}"
									escapeXml="false" />
							</c:if> <c:if test="${empty param.key }">
								<c:out value='${message[8] }' escapeXml="false" />
							</c:if></td>
						</tr>
					</c:if>
					<c:if test="${openValue==4}">

						<tr>
							<td align=left width=100% colspan=2
								style="font-size: 12px; color: #808080"><c:out
								value='${context.text_start }' />：<font color="green"><c:out
								value='${message[9] }' default='-' /></font>  </td>
						</tr>
						<tr>
							<td align=left width=100% colspan=2
								style="font-size: 12px; color: #808080"><c:out
								value='${context.text_end }' />：<font color="green"><c:out
								value='${message[10] }' default='-' /></font></td>
						</tr>

					</c:if>
					<tr>
						<td align=left colspan=2 style="font-size: 12px; color: #808080"><c:out
							value='${context.text_publish }' />：<c:out
							value='${message[3] }' /><c:set var="lastComment"
							value='${message[0] }lastComment' />&nbsp;<c:if
							test="${not empty requestScope[lastComment] }">
							<c:out value='${context.text_last_reply }' />：<c:out
								value='${requestScope[lastComment] }' />
						</c:if></td>
					</tr>
					<tr>
						<td align=left width=100% colspan=2
							style="font-size: 12px; color: #808080"><c:out
							value='${context.text_click }' />：<c:out value='${message[5] }' />
						&nbsp;<c:out value='${context.text_comment }' />：<c:set
							var="commentNum" value='${message[0] }commentNum' /><c:out
							value='${requestScope[commentNum] }' /></td>
					</tr>

				</table>

				<br>
				</td>
			</tr>


		</c:forEach>

	</c:if>





	<tr>
		<td height=30></td>
	</tr>
	<tr bgcolor="#ffffff">
		<td align=left colspan=2><c:set var="pid" value="${startpid }" /> <c:forEach
			begin="${startpid }" end="${endpid }" step="1">
			<c:if test="${!(context.encryptedUrl1) }">
				<c:set var="url"
					value="/group/myFavourite${context.postfix}?pageid=${pid}&open=${openValue }" />
				<c:if test='${not empty (param.key) }'>
					<c:set var="url" value="${url }&key=${param.key}" />
				</c:if>
				<a href="${url }"
					<c:if test='${intpageid==pid }'>style="font-weight:bold;color:red;"</c:if>>[<c:out
					value='${pid}' />]</a>
			</c:if>
			<c:if test="${(context.encryptedUrl1) }">
				<c:set var='urlFragmentStr'
					value="?pageid=${pid}&open=${openValue }" />
				<c:if test='${not empty param.key }'>
					<c:set var="urlFragmentStr"
						value="${urlFragmentStr }&key=${param.key}" />
				</c:if>
				<c:set var='urlFragment'
					value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
				<a
					<c:if test='${intpageid==pid }'>style="font-weight:bold;color:red;"</c:if>
					href="/group/myFavourite<c:out value='${context.postfix}' />/~<c:out value='${urlFragment }' />">
				[<c:out value='${pid}' />]</a>
			</c:if>
			<c:set var="pid" value="${pid+1 }" />
&nbsp;&nbsp;</c:forEach> <c:if test="${intpageid>1 }">
			<c:if test="${!(context.encryptedUrl1) }">
				<c:set var="url"
					value="/group/myFavourite${context.postfix}?pageid=${intpageid-1}&open=${openValue }" />
				<c:if test='${not empty (param.key) }'>
					<c:set var="url" value="${url }&key=${param.key}" />
				</c:if>

				<a href="${url }"> [<c:out value='${context.previous_page}' />]
				</a>
			</c:if>
			<c:if test="${(context.encryptedUrl1) }">
				<c:set var='urlFragmentStr'
					value="?pageid=${intpageid-1}&open=${openValue }" />
				<c:if test='${not empty param.key }'>
					<c:set var="urlFragmentStr"
						value="${urlFragmentStr }&key=${param.key}" />
				</c:if>
				<c:set var='urlFragment'
					value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
				<a
					href="/group/myFavourite<c:out value='${context.postfix}' />/~<c:out value='${urlFragment }' />">
				[<c:out value='${context.previous_page}' />] </a>
			</c:if>
&nbsp;
</c:if> <c:if test="${intpageid<pagenums }">
			<c:if test="${!(context.encryptedUrl1) }">
				<c:set var="url"
					value="/group/myFavourite${context.postfix}?pageid=${intpageid+1}&open=${openValue }" />
				<c:if test='${not empty (param.key) }'>
					<c:set var="url" value="${url }&key=${param.key}" />
				</c:if>
				<a href="${url }"> [<c:out value='${context.next_page}' />] </a>
			</c:if>
			<c:if test="${(context.encryptedUrl1) }">
				<c:set var='urlFragmentStr'
					value="?pageid=${intpageid+1}&open=${openValue }" />
				<c:if test='${not empty param.key }'>
					<c:set var="urlFragmentStr"
						value="${urlFragmentStr }&key=${param.key}" />
				</c:if>
				<c:set var='urlFragment'
					value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
				<a
					href="/group/myFavourite<c:out value='${context.postfix}' />/~<c:out value='${urlFragment }' />">
				[<c:out value='${context.next_page}' />] </a>
			</c:if>
&nbsp;
</c:if></td>
	</tr>


</table>



</body>

